﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WCFContracts;
using TrainingWorkshop.IDAL;

namespace WCFServices
{
    /// <summary>
    /// Author:Sissi-Zeng
    /// Date:2012-8-28 20:00
    /// Class ProjectBService provides a set of services to client.
    /// In this part, ProjectBService implements IProjectService methods in StudentBU,,which is a service contract
    /// </summary>
    public partial class ProjectBService : IProjectBService
    {
        /// <summary>
        /// get all students from factory who take the course
        /// </summary>
        /// <param name="courseId">given courseId</param>
        /// <returns>list of student</returns>
        public List<TrainingWorkshop.Model.Student> GetStudentListByCourse(int courseId)
        {
            IStudentRepository studentRep = factory.CreateStudentRepository();
            return studentRep.GetStudentListByCourse(courseId);
        }

        /// <summary>
        /// get all students from factory who don't take the course
        /// </summary>
        /// <param name="courseId">given courseId</param>
        /// <returns>list of student</returns>
        public List<TrainingWorkshop.Model.Student> GetStudentListsNoInCourse(int courseId)
        {
            IStudentRepository studentRep = factory.CreateStudentRepository();
            return studentRep.GetStudentListNotInCourse(courseId);
        }
    }
}
